﻿<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">

    <!--Button template 1-->
    <Style x:Key="btnTwo"
           TargetType="{x:Type Button}">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type Button}">
                    <Border x:Name="Overlay"
                            CornerRadius="10"
                            Margin="0"
                            BorderThickness="1"
                            BorderBrush="#82BFBFBF"
                            Background="#80006699">
                        <ContentPresenter VerticalAlignment="Center"
                                          HorizontalAlignment="Center"
                                          Margin="8,6,8,6" />
                    </Border>
                    <ControlTemplate.Triggers>
                        <Trigger Property="IsMouseOver"
                                 Value="True">
                            <Setter TargetName="Overlay"
                                    Property="Background">
                                <Setter.Value>
                                    <SolidColorBrush Color="#FF3D60A8"
                                                     Opacity="0.85" />
                                </Setter.Value>
                            </Setter>
                        </Trigger>
                        <Trigger Property="IsPressed"
                                 Value="True">
                            <Setter TargetName="Overlay"
                                    Property="Background"
                                    Value="Black" />
                        </Trigger>
                        <Trigger Property="IsEnabled"
                                 Value="False">
                            <Setter TargetName="Overlay"
                                    Property="Background">
                                <Setter.Value>
                                    <SolidColorBrush Color="#FFACA9A9" 
                                                     Opacity="0.30"/>
                                </Setter.Value>
                            </Setter>

                        </Trigger>

                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
        <Setter Property="Foreground"
                Value="WhiteSmoke" />
    </Style>

    <!--Button template 2-->
    <Style x:Key="btnThree"
           TargetType="{x:Type Button}">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type Button}">
                    <Border x:Name="Overlay"
                            CornerRadius="10"
                            Margin="0"
                            BorderThickness="1"
                            BorderBrush="#82BFBFBF"
                            Background="#80006699">
                        <ContentPresenter VerticalAlignment="Center"
                                          HorizontalAlignment="Center"
                                          Margin="8,6,8,6" />
                    </Border>
                    <ControlTemplate.Triggers>
                        <Trigger Property="IsMouseOver"
                                 Value="True">
                            <Setter TargetName="Overlay"
                                    Property="Background">
                                <Setter.Value>
                                    <SolidColorBrush Color="#FF3D60A8"
                                                     Opacity="0.85" />
                                </Setter.Value>
                            </Setter>
                        </Trigger>
                        <Trigger Property="IsPressed"
                                 Value="True">
                            <Setter TargetName="Overlay"
                                    Property="Background"
                                    Value="Black" />
                        </Trigger>
                        <Trigger Property="IsEnabled"
                                 Value="False">
                            
                            
                            <Setter TargetName="Overlay"
                                    Property="Background">
                                <Setter.Value>
                                    <SolidColorBrush Color="#FFACA9A9"
                                                     Opacity="0.20" />
                                </Setter.Value>
                            </Setter>
                        </Trigger>

                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
        <Setter Property="Foreground"
                Value="WhiteSmoke" />
        <Setter Property="IsEnabled"
                Value="False" />
        <Style.Triggers>
            <MultiDataTrigger>
                <MultiDataTrigger.Conditions>
                    <Condition Binding="{Binding ElementName=txtLimit, Path=(Validation.HasError)}"
                               Value="False" />
                </MultiDataTrigger.Conditions>
                <Setter Property="IsEnabled"
                        Value="True" />
            </MultiDataTrigger>
        </Style.Triggers>
    </Style>

    <!--Menu Gradient-->
    <Style TargetType="{x:Type Menu}"
           x:Key="CustomMenu">
        <Setter Property="OverridesDefaultStyle"
                Value="True" />
        <Setter Property="SnapsToDevicePixels"
                Value="True" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type Menu}">
                    <Border BorderThickness="1">
                        <Border.BorderBrush>
                            <LinearGradientBrush StartPoint="0,0"
                                                 EndPoint="0,1">
                                <LinearGradientBrush.GradientStops>
                                    <GradientStopCollection>
                                        <GradientStop Color="{DynamicResource BorderLightColor}"
                                                      Offset="0.0" />
                                        <GradientStop Color="{DynamicResource BorderDarkColor}"
                                                      Offset="1.0" />
                                    </GradientStopCollection>
                                </LinearGradientBrush.GradientStops>
                            </LinearGradientBrush>

                        </Border.BorderBrush>
                        <Border.Background>
                            <LinearGradientBrush EndPoint="0.5,2"
                                                 StartPoint="0.5,0">
                                <GradientStop Color="#60006699"
                                              Offset="0" />
                                <GradientStop Color="{DynamicResource ControlMediumColor}"
                                              Offset="1" />
                            </LinearGradientBrush>
                        </Border.Background>
                        <StackPanel ClipToBounds="True"
                                    Orientation="Horizontal"
                                    IsItemsHost="True" />
                    </Border>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <!--Custom checkbox template-->
    <Style TargetType="{x:Type CheckBox}"
           x:Key="CustomCheck">
        <Setter Property="SnapsToDevicePixels"
                Value="true" />
        <Setter Property="OverridesDefaultStyle"
                Value="true" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="CheckBox">
                    <BulletDecorator Background="Transparent">
                        <BulletDecorator.Bullet>
                            <Border x:Name="Border"
                                    Width="13"
                                    Height="13"
                                    CornerRadius="0"
                                    Background="White"
                                    BorderThickness="1"
                                    BorderBrush="Gray">
                                <Path Width="7"
                                      Height="7"
                                      x:Name="CheckMark"
                                      SnapsToDevicePixels="False"
                                      Stroke="#60006699"
                                      StrokeThickness="2"
                                      Data="M 0 0 L 7 7 M 0 7 L 7 0" />
                            </Border>
                        </BulletDecorator.Bullet>
                        <ContentPresenter Margin="4,0,0,0"
                                          VerticalAlignment="Center"
                                          HorizontalAlignment="Left"
                                          RecognizesAccessKey="True" />
                    </BulletDecorator>
                    <ControlTemplate.Triggers>
                        <Trigger Property="IsChecked"
                                 Value="false">
                            <Setter TargetName="CheckMark"
                                    Property="Visibility"
                                    Value="Collapsed" />
                        </Trigger>
                        <Trigger Property="IsChecked"
                                 Value="{x:Null}">
                            <Setter TargetName="CheckMark"
                                    Property="Data"
                                    Value="M 0 7 L 7 0" />
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>

        <Setter Property="Validation.ErrorTemplate">
            <Setter.Value>
                <ControlTemplate>
                    <DockPanel LastChildFill="True">
                    

                    </DockPanel>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    
    <!--Label customization-->
    <Style TargetType="{x:Type Label}"
           x:Key="CustomLabel">
        <Setter Property="FontWeight"
                Value="SemiBold" />
        <Setter Property="FontSize"
                Value="15" />
    </Style>
    
    <!--Textbox validation styling-->
    <Style TargetType="{x:Type TextBox}"
           x:Key="CheckError">
        <Setter Property="Validation.ErrorTemplate">
            <Setter.Value>
                <ControlTemplate>
                    <DockPanel LastChildFill="True">
                        <TextBlock DockPanel.Dock="Right"
                                   Foreground="Red"
                                   FontSize="13"
                                   FontWeight="Bold"
                                   Text="{Binding ElementName=CustomAdorner, Path=AdornedElement.(Validation.Errors)[0].ErrorContent}">
                        </TextBlock>
                        <Border BorderBrush="Red"
                                BorderThickness="2">
                            <AdornedElementPlaceholder Name="CustomAdorner" />
                        </Border>
                    </DockPanel>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
        <Style.Triggers>
            <Trigger Property="Validation.HasError" Value="true">
                <Setter Property="ToolTip"
                        Value="{Binding RelativeSource={RelativeSource Self}, Path=(Validation.Errors)[0].ErrorContet}" />
            </Trigger>
        </Style.Triggers>
    </Style>
    
</ResourceDictionary>